<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function throttle(fn,delay){
            var timer = null;
            return function(){
                var slef = this;
                var args = arguments;
                if(!timer){
                    timer = setTimeout(function(){
                        fn.apply(slef,args);
                        timer = null;
                    },delay)
                }
            }
        } 
        function handle(){
            console.log(Math.random());
        } 
        window.addEventListener("mousemove",throttle(handle,1000));
    </script>
</body>
</html>